package com.whfc.cncit.entity;

import com.whfc.cncit.constant.CncitConst;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author : qzexing
 * @version : 1.0
 * @date : 2020/6/30 14:28
 */
@Data
@NoArgsConstructor
public class CncitDwMsgPS extends CncitDwMsg {

    /**
     * 设置类型
     */
    private String type;

    /**
     * 参数
     */
    private String param;

    public CncitDwMsgPS(String deviceCode, String type, String param) {
        this.deviceCode = deviceCode;
        this.type = type;
        this.param = param;
    }

    @Override
    public String getCmd() {
        return CncitConst.DW_CMD_PS;
    }

    @Override
    public int getDataLength() {
        //$16,PS,0,TTSD,你好,#\n
        return getCmd().length() + 1 + CncitConst.PLATFORM.length() + 1 + type.length() + 1 + param.length() + 1 + 1;
    }
}
